package StudyCode.summary.mycollection;

import java.util.ArrayList;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class RemoveTheItemFromListByValue {
	public static void main(String[] args) {
		ArrayList<String> items = new ArrayList<>();

		items.add("red");
		items.add(0, "yellow");


		items.remove("yellow");
		display(items, "移除第一个 yellow:");

	}

	public static void display(ArrayList<String> items, String header) {
		System.out.print(header);

		for (String item : items)
			System.out.printf(" %s", item);

		System.out.println();
	}
}
